package test1;

import java.net.MalformedURLException;

import com.caucho.hessian.client.HessianProxyFactory;

import nonre.sgy.service.IHelloService;

public class Client {
    public static void main(String[] args) throws MalformedURLException {
        // Hessian代理工厂
        HessianProxyFactory factory = new HessianProxyFactory();
        // 访问配置的Servlet路径
        String url = "http://localhost:8080/hessianservice/remoting/helloServiceExporter";

        // 使用Hessian工厂获得接口的具体实现类
        IHelloService helloService=(IHelloService) factory.create(IHelloService.class,url);

        System.out.println(helloService.say("is working"));
    }
}